﻿using System.Linq;
using HtmlAgilityPack;

namespace BattleNet.DataAccess.Extensions
{
    public static class HtmlNodeExtensions
    {
        public static bool HasClass(this HtmlNode node, string className)
        {
            return node.GetAttributeValue("class", string.Empty).Split(' ').Any(c=>c == className);
        }

        public static string GetAttributeValue(this HtmlNode node, string attribute)
        {
            return node.GetAttributeValue(attribute, null);
        }
        
    }
}
